#!/usr/bin/php
<?php

if (php_sapi_name() !== 'cli') {
    exit();
}

require __DIR__ . '/vendor/autoload.php';

use Minicli\App;
use Minicli\CommandCall;

define("FRAME_BASE_PATH", __DIR__);

$app = new App();

$app->registerCommand('name', function (CommandCall $call) use ($app) {
    print_r($call->params);
});

$app->registerCommand('help', function (CommandCall $call) use ($app) {
    $app->getPrinter()->display("usage: minicli hello [ your-name ]");
});

$app->registerController('hello', \App\Command\HelloController::class);

$app->runCommand($argv);
